<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="include/peizhi.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="${ctx}">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
        
        <title>后台管理中心</title> 
		<link rel="stylesheet" href="${ctx}/css/pintuer.css" /> 
		<link rel="stylesheet" href="${ctx}/css/admin.css" /> 
        <script type="text/javascript" src="${ctx}/js/jquery-1.9.1.min.js"></script>
    </head>
  	<body style="background-color:#f2f9fd;"> 
	 <div class="bg"></div>
	<div class="container">
	    <div class="line bouncein">
	        <div class="xs6 xm4 xs3-move xm4-move">
	            <div style="height:150px;"></div>
	            <div class="media media-y margin-big-bottom">           
	            </div>         
	            <form id='formlogin' method="post">
	            <div class="panel loginbox">
	                <div class="text-center margin-big padding-big-top"><h1>后台管理中心</h1></div>
	                <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input input-big" name="name" placeholder="登录账号" data-validate="required:请填写账号" />
	                            <span class="icon icon-user margin-small"></span>
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="password" class="input input-big" name="password" placeholder="登录密码" data-validate="required:请填写密码" />
	                            <span class="icon icon-key margin-small"></span>
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <div class="field">
	                            <input type="text" class="input input-big" name="code" placeholder="填写右侧的验证码" data-validate="required:请填写右侧的验证码" />
	                           <img src="${ctx}/images/passcode.jpg" alt="" width="100" height="32" class="passcode" style="height:43px;cursor:pointer;" onclick="this.src=this.src+'?'">  
	                                                   
	                        </div>
	                    </div>
	                </div>
	                <div style="padding:30px;"><input type="button" id='submilogin' class="button button-block bg-main text-big input-big" value="登录"></div>
	            </div>
	            </form>          
	        </div>
	    </div>
	</div>
 </body>
 <script type="text/javascript">
 	$("#submilogin").click(function(){
 		//alert("aaaaaaa");
 		$.ajax({
 			url:"${ctx}/login/main",
 			type:"post",
 			data:$("#formlogin").serialize(),
 			success:function(data){
 				if(data=='0'){
 					window.location.href="${ctx}/index"; 
 				}else if(data=='1'){
 					alert("用户不存在");
 				}else if(data=='2'){
 					alert("密码不正确");
 				}
 			}
 		});
 	});
 
 </script>
</html>